#!/usr/bin/env python
# -*- coding: utf-8 -*-

from code      import Code

""" ラベル定義クラス """
class Label:
	def __init__(self, name, body):
		self.name = name
		self.body = body
	def run(self, writer):
		# 命令書き込み
		writer.writeLabel(self.name)
		writer.writeLog("ラベル作成 '%s'"%self.name)
		self.body.run(writer)

		# [opecode]
		# [1      ]
		# = 1byte
		writer.writeByte(Code.CODE_LABEL_END)
		writer.writeLog("ラベル終了 '%s'"%self.name)
		